#include "Camera.h"

int main(int argc, char *argv[])
{   

    // JSON Test
    Json::Reader reader;
    Json::Value root;
    string ConfigFileName = "./config/configure.json";
    ifstream File;
    File.open(ConfigFileName, ios::binary);
    reader.parse(File, root);

    string Device = root["Devices"][0]["Device"].asString();

    string Re = root["Devices"][0]["Resolution"].asString();


    Setting data =  { "/dev/video1", "640X480" };

    Camera camera(data);
 
    int initRes = camera.init(false);
    if(initRes < 0)
    {
        return initRes;
    }
    
    camera.version();
    int CameraStatus = camera.cheese();
    if(CameraStatus < 0)
    {
        return CameraStatus;
    }

    camera.release();

    return 0;
}
